---
import BaseLayout from "@layouts/Layout.astro"
import { getall } from "@libs/config/dbconfig"
const res = await getall()

// const meta = {
// 	title: `Blog ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
// 	description: SITE.description,
// 	canonical: getCanonical(getPermalink(page.url.current)),
// 	ogType: "blog",
// 	noindex: currentPage > 1
// };
const title = "Api"
const description =
  "Astro-Ink is a crisp, minimal, personal blog theme for Astro"
---

<BaseLayout content={{ title, description }}>
  {
    res.map((e: { id: any; title: unknown; description: unknown }) => (
      <div class="px-5 py-2 text-center flex flex-col">
        <h1>
          <a href={`/api/${e.id}`}>{e.title}</a>
        </h1>
        <p>{e.description}</p>
      </div>
    ))
  }
</BaseLayout>

<style>
  h1 {
    @apply font-extrabold  font-extrabold text-4xl colors-primary flex font-sans;
  }
  p {
    @apply colors-secondary  text-xl flex font-sans flex;
  }
</style>
